#ifndef _NODE_H_
#define _NODE_H_

#ifndef _IOSTREAM_
#include <iostream>
#endif

#ifndef NULL
#define NULL 0
#endif

using std::cout;
using std::cin;

// Class
//----------------------------------------------------------------------------//
template <typename T>
class Node
{
private:
	Node<T> *pPrev, *pNext;
	T* const pData;

public:
	Node(T* pData);
	~Node();

	Node<T>* getPrev();
	Node<T>* getNext();
	bool setPrev(Node<T>* pNode);
	bool setNext(Node<T>* pNode);
	T* getData();
};

// Public
//----------------------------------------------------------------------------//
template <typename T>
Node<T>::Node(T* pData)
	:pData(pData)
{
	this->pNext = NULL;
	this->pPrev = NULL;
}

// Public
//----------------------------------------------------------------------------//
template <typename T>
Node<T>::~Node()
{
}

// Public
//----------------------------------------------------------------------------//
template <typename T>
Node<T>* Node<T>::getPrev()
{
	return this->pPrev;
}

// Public
//----------------------------------------------------------------------------//
template <typename T>
Node<T>* Node<T>::getNext()
{
	return this->pNext;
}

// Public
//----------------------------------------------------------------------------//
template <typename T>
bool Node<T>::setPrev(Node<T> *pNode)
{
	this->pPrev = pNode;
	return true;
}

// Public
//----------------------------------------------------------------------------//
template <typename T>
bool Node<T>::setNext(Node<T> *pNode)
{
	this->pNext = pNode;
	return true;
}

// Public
//----------------------------------------------------------------------------//
template <typename T>
T* Node<T>::getData()
{
	return this->pData;
}


#endif